package com.whale.nangua.pumpkingobang.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class ReplayData implements Serializable {
    private String gameId;
    private String endTime;
    private List<MoveInfo> moveInfos; // 用于存储落子信息的列表

    public ReplayData(String gameId, String endTime) {
        this.gameId = gameId;
        this.endTime = endTime;
        this.moveInfos = new ArrayList<>();
    }

    public String getGameId() {
        return gameId;
    }

    public String getEndTime() {
        return endTime;
    }

    public List<MoveInfo> getMoveInfos() {
        return moveInfos;
    }

    public void addMoveInfo(List<MoveInfo> moveInfoList) {
        moveInfos = moveInfoList;
    }

    // 内部类用于表示每一步的落子信息
    public static class MoveInfo implements Serializable{
        private int xCoordinate;
        private int yCoordinate;
        private int playerColor;
        private int moveOrder;

        public MoveInfo(int xCoordinate, int yCoordinate, int playerColor, int moveOrder) {
            this.xCoordinate = xCoordinate;
            this.yCoordinate = yCoordinate;
            this.playerColor = playerColor;
            this.moveOrder = moveOrder;
        }

        public int getxCoordinate() {
            return xCoordinate;
        }

        public int getyCoordinate() {
            return yCoordinate;
        }

        public int getPlayerColor() {
            return playerColor;
        }

        public int getMoveOrder() {
            return moveOrder;
        }
    }
}